/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.uparis10.m2miageclassic.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;

/**
 *
 * @author abcamara
 */
@Entity
public class EC implements Serializable {
    @ManyToOne
    private UE uE;

    public UE getuE() {
        return uE;
    }

    public void setuE(UE uE) {
        this.uE = uE;
    }
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String nom;
    private long volumeHTD;
    private long voulumeHCM;
    

    @ManyToMany
    private Collection<Enseignant> lesEnseignats;
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EC)) {
            return false;
        }
        EC other = (EC) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return this.nom;
    }

    /**
     * @return the nom
     */
    public String getNom() {
        return nom;
    }

    /**
     * @param nom the nom to set
     */
    public void setNom(String nom) {
        this.nom = nom;
    }

    /**
     * @return the volumeHTD
     */
    public long getVolumeHTD() {
        return volumeHTD;
    }

    /**
     * @param volumeHTD the volumeHTD to set
     */
    public void setVolumeHTD(long volumeHTD) {
        this.volumeHTD = volumeHTD;
    }

    /**
     * @return the voulumeHCM
     */
    public long getVoulumeHCM() {
        return voulumeHCM;
    }

    /**
     * @param voulumeHCM the voulumeHCM to set
     */
    public void setVoulumeHCM(long voulumeHCM) {
        this.voulumeHCM = voulumeHCM;
    }

    /**
     * @return the lesEnseignats
     */
    public Collection<Enseignant> getLesEnseignats() {
        return lesEnseignats;
    }

    /**
     * @param lesEnseignats the lesEnseignats to set
     */
    public void setLesEnseignats(Collection<Enseignant> lesEnseignats) {
        this.lesEnseignats = lesEnseignats;
    }
    
}
